#!/bin/bash

# checkout from SVN into this directory ... 
#

E_BADARGS=65

if [ ! -n "$1" ]
then
  echo "FAILED: No Version passed to script!!"
  exit $E_BADARGS
fi

cd ../..
pwd

echo "Clearing processing scripts ...<br>"
rm -f html/management/updatefromsvn.sh

echo "Shell: Running SVN CHECKOUT:<br>"
echo "<TEXTAREA NAME="SVN Checkout Output" COLS=80 ROWS=20>"
#
# Edit and un-comment the line below and add the username and password, and path!
#
# Example: svn -r "$1" checkout --username {put username here} --password {put password here} http://trac.sndev.us/svn/sndev/trunk .
#
svn -r "$1" checkout --username {username} --password {username} {svn_url} .
#
# Then comment this line below:
#echo "The updatefromsvn.sh file has not been properly edited!"

echo "</TEXTAREA><br>"

echo "<b>NOTE:</b>Running dos2unix/chown/chmod on updatefromsvn.sh ...<br><br>"
dos2unix html/management/updatefromsvn.sh
chown apache:apache html/management/updatefromsvn.sh
chmod +x html/management/updatefromsvn.sh

echo "SVN Checkout Completed!  Returning from shell script ..."
